package com.ruoyi.common.filter;

import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;

/**
 * 排除JSON敏感属性
 * 
 * @author ruoyi
 */
@JsonFilter("PropertyPreExcludeFilter")
public class PropertyPreExcludeFilter extends SimpleFilterProvider
{
    public PropertyPreExcludeFilter(String... filters)
    {
        super();
        this.addFilter(this.getClass().getAnnotation(JsonFilter.class).value(), SimpleBeanPropertyFilter.serializeAllExcept(filters));
    }
}
